"""
@Project:${2108a 人工智能}
@File:login_auth.py
@Author:周家昌
@Date:10:32
"""
from functools import wraps
from flask import request,g,jsonify
from common.utils.token_utils import token_auth

def login_auth(func):
    wraps(func)
    def interior(*args,**kwargs):
        # token = request.headers.get('Authorization')
        # token = token[4:]
        # print(token)
        # payload = token_auth(token)
        # print('***',payload)
        if 1:
            # g.uid = payload.get('id')
            return func(*args,**kwargs)
        else:
            return jsonify(code=401,msg = '请先登录')

    return interior